<?php
require_once(preg_replace('/members$/', '', dirname(__FILE__))."inc.config.php");

$_error_report_code = $vars["debug"]? (E_ALL - E_NOTICE) : 0;
error_reporting($_error_report_code);

session_start();
require_once(M_ROOT."/functions/common/common.php");
require_once(M_ROOT."/functions/general_function.php");
require_once(M_ROOT."/initialize.php");

initialize();
$field_cookie_salt = md5("user_cookie_salt".SECRET_KEY);
if(isset($_COOKIE[$field_cookie_salt])){
 $cookie_salt = $_COOKIE[$field_cookie_salt];
 $field_username = md5("u_u".$cookie_salt.SECRET_KEY);
 $field_password = md5("u_p".$cookie_salt.SECRET_KEY);
 setcookie($field_cookie_salt, "", time()-3600);
 unset($_SESSION["uid"]);
 unset($_SESSION["cookie_chk"][$field_username]);
 unset($_SESSION["cookie_chk"][$field_password]);
 setcookie($field_username, "", time()-3600);
 setcookie($field_password, "", time()-3300);
}

header("location: ".M_URL."/".$vars["file"]["public"]["index"]);
exit();
?>